# map 高阶函数
from cgi import print_environ_usage

# def abc(num):
#     num = int(num)
#     num = num ** 2
#     return num
#
#
# res = map(abc, ['10','20','30'])
#
# print(list(res))



# 集合，无序的数据类型

# s = {1,2,3,4,5,6}
# s.pop()
# s.pop()     # 随机弹出一个元素
# s.pop()
# print(s)


# 列表，有序的
# l = [1,2,3,4,5,6]
# l.pop()
# print(l)


# set1 = {1, 2, 3, 4, 5}
# set2 = {4, 5, 6, 7, 8}
# set3 = set1.union(set2)
# set4 = set1.intersection(set2)
# print("集合1:", set1)
# print("集合3:", set3)
# print("集合2:", set2)
# print("set4:", set4)


# # 字典的定义
# d = {}
# d1 = dict()
#
# # 集合
# s = set()


# text = "hello how are you hello again"
# word_count = {}
# for word in text.split(' '):
#     if word not in word_count:
#         word_count[word] = 1
#     else:
#         word_count[word] += 1
#
# print(word_count)


# 列表推导式

# lis = []
# for i in range(10):
#     if i % 2 == 0:
#         lis.append(i)
#
# print(lis)
#
#
# lis1 = [i for i in range(10) if i % 2 == 0]
# print(lis1)



# 身份证信息提取
# 18 位身份证号码第 7~10 位为出生年份（4 位数），第 11~12 位为出生月份，第 13~14 位代表出生日期，第 17 位代表性别（奇数为男，偶数为女）。
# 用户输入一个合法的身份证号，请输出用户的出生年月日和性别。


id_num = input("请输入您的身份证号码：")   # 字符串 "450821200510084970"

y = id_num[6:10]
m = id_num[10:12]
d = id_num[12:14]
sex = int(id_num[17])   # 不考虑X的情况


if str(sex) == "X":
    sex = '女'
elif sex % 2 == 0:
    sex = '女'
else:
    sex = '男'

print(f"出生年月日为：年：{y}，月:{m}，日{d}，是个{sex}的")






